package com.zhaoyue.study.concurrency.thread.daemon;

import java.util.concurrent.LinkedBlockingDeque;

/**
 * Created with IntelliJ IDEA.
 * User: zhaoyue
 * Date: 2016/8/30
 * Time: 17:34
 *
 * 守护线程
 *
 */
public class Task {

    public static void main(String[] args) {

        LinkedBlockingDeque<Event> deque = new LinkedBlockingDeque<Event>();
        WriteTask writeTask = new WriteTask(deque);
        for(int i=0;i<3;i++){
            Thread thread = new Thread(writeTask);
            thread.start();
        }

        CleanTask cleanTask = new CleanTask(deque);
        System.out.println(cleanTask.isDaemon());//判断是否为守护线程
        cleanTask.start();
    }

}
